<template>
  <div class="top">
    <div class="suffix-container">
      <div class="normal-wrap">
        <div class="normal-avatar">
          <div class="avatar-circle"><div class="avatar-img" :style="{ backgroundImage: 'url(' + headImgUrl + ')' }"></div></div>
        </div>
        <div class="normal-title">{{ nickname }}</div>
      </div>
    </div>
    <div class="setting-list">
      <div class="setting-list-item" @click="getData">
        <div class="item-icon"><img src="../../assets/pictures/数据.png" class="asset-data" /></div>
        <div class="setting-list-wrap">
          <div class="setting-list-name">我的数据</div>
          <div class="iconfont"><img src="../../assets/pictures/箭头.png" class="icon-img" /></div>
        </div>
      </div>
      <div class="setting-list-item" @click="upload">
        <div class="item-icon"><img src="../../assets/pictures/上传.png" class="asset-data" /></div>
        <div class="setting-list-wrap">
          <div class="setting-list-name">上传文章</div>
          <div class="iconfont"><img src="../../assets/pictures/箭头.png" class="icon-img"/></div>
        </div>
      </div>
      <div class="setting-list-item" @click="myShare">
        <div class="item-icon"><img src="../../assets/pictures/分享.png" class="asset-share" /></div>
        <div class="setting-list-wrap">
          <div class="setting-list-name">我的分享</div>
          <div class="iconfont"><img src="../../assets/pictures/箭头.png" class="icon-img" /></div>
        </div>
      </div>
      <div class="setting-list-item" @click="call">
        <div class="item-icon"><img src="../../assets/pictures/联系我们.png" class="asset-call" /></div>
        <div class="setting-list-wrap">
          <div class="setting-list-name">联系我们</div>
          <div class="iconfont"><img src="../../assets/pictures/箭头.png" class="icon-img" /></div>
        </div>
      </div>
      <div class="setting-list-item" @click="getUtil">
        <div class="item-icon"><img src="../../assets/pictures/问号.png" class="asset-que" /></div>
        <div class="setting-list-wrap">
          <div class="setting-list-name">使用攻略</div>
          <div class="iconfont"><img src="../../assets/pictures/箭头.png" class="icon-img" /></div>
        </div>
      </div>
      <div class="setting-list-item" @click="setting">
        <div class="item-icon"><img src="../../assets/pictures/设置.png" class="asset-set" /></div>
        <div class="setting-list-wrap">
          <div class="setting-list-name">设置中心</div>
          <div class="iconfont"><img src="../../assets/pictures/箭头.png" class="icon-img" /></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { Indicator } from 'mint-ui';
import { Toast } from 'mint-ui';
export default {
  name: 'My',
  data() {
    return {
      busy: true,
      visitor: [],
      headImgUrl: '',
      nickname: ''
    };
  },
  methods: {
    getData: function() {
      Indicator.open({
        text: '加载中...',
        spinnerType: 'fading-circle'
      });
      this.$router.push({ name: 'myData' });
    },
    myShare: function() {
      this.$router.push({ name: 'myShare' });
    },
    call: function() {
      let toastInstanse = Toast({
        message: '请添加微信：abi521180', //弹窗内容
        position: 'middle', //弹窗位置
        duration: 5000 //弹窗时间毫秒,如果值为-1，则不会消失
      });
    },
    getUtil: function() {
      this.$router.push({ name: 'util' });
    },
    setting: function() {
      this.$router.push({ name: 'setting' });
    },
    upload: function() {
      this.$router.push({ name: 'upload' });
    }
  },
  created() {
    this.nickname = localStorage.getItem('nickname');
    this.headImgUrl = localStorage.getItem('headImgUrl');
  },
  beforeDestroy() {
    Indicator.close();
  }
};
</script>

<style>
.asset-data {
  width: 37px;
  margin-left: 40px;
}
.asset-share {
  width: 30px;
  margin-left: 40px;
}
.asset-call {
  width: 40px;
  margin-left: 30px;
}
.icon-img {
  width: 25px;
}
.asset-que {
  width: 40px;
  margin-left: 35px;
}
.asset-set {
  width: 34px;
  margin-left: 35px;
}
.top {
  margin-bottom: 55px;
}
.iconfont {
  font-family: 'iconfont' !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 60px;
}

.setting-list-name {
  font-size: 20px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  margin-left: 20px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}

.setting-list-wrap {
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  height: 100%;
  padding-right: 6px;
}

.item-icon {
  width: 80px;
  text-align: center;
}

.setting-list-item {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  width: 100%;
  height: 80px;
  padding: 0;
  /* font-size: 5px; */
  color: #333;
}

.setting-list,
.setting-list-set,
.setting-list-vip {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
}

.setting-list {
  border-top: 90px solid #fff;
}

.normal-title {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  margin: 2px auto;
  text-align: center;
  font-size: 27px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: no-repeat 50% / cover;
  border: none;
}

.avatar-circle {
  width: 110px;
  height: 110px;
  overflow: hidden;
  background-clip: initial;
  border-radius: 50%;
}

.normal-avatar {
  width: 125px;
  height: 125px;
  margin: 5px 35px 20px 120px;
  text-align: center;
  padding-top: 20px;
}

.suffix-container {
  position: relative;
  margin: 7px 32px 0;
  height: 150px;
  background-color: #fff;
}

.normal-wrap {
  height: 220px;
  width: 350px;
  background-color: #fff;
  background-image: url(../../assets/pictures/background.png);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% auto;
  border-radius: 1px;
  box-shadow: 0 16px 48px 0 rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  outline: none;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

* {
  margin: 0;
  padding: 0;
}

div {
  display: block;
}
</style>
